home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PRINTER / PROHP.ARJ / DCALENDA.PRG < prev    next >
Text File  |  1992-06-23  |  2KB  |  58 lines

  1. /*
  2.   ┌─────────────────────────────────────────────────────────────────────────┐
  3.   │                                                                         │
  4.   │    Program : calendar.PRG                                               │
  5.   │                                                                         │
  6.   │    Purpose : demonstrate the use of HPdrawmonth.                        │
  7.   │                                                                         │
  8.   │   Author  : Copyright (C) 1992, I.L.A.,Inc. All Rights reserved.        │
  9.   │                                                                         │
  10.   │   Comments: This source code may be distributed and used freely         │
  11.   │             provided that the copyright notice is not removed.          │
  12.   │                                                                         │
  13.   └─────────────────────────────────────────────────────────────────────────┘
  14.  
  15. */
  16. #include "prohp.ch"
  17.  
  18. proc main()
  19. Local nPageH:=7.5 , nPageW:=10 , nCalSp := 0.3
  20. Local nTop := 0, nLeft := 0.2, nCalH := nPageH/2 -nCalSp
  21. Local nDayW,nDayH
  22. Local nCalW:=nPageW, date:=date(), aCal
  23.  
  24. HP_init()
  25. HP_send(.T.)
  26. set2print("dcalend.hpc")
  27. HP_orient(LANDSCAPE)
  28. HPshadow(.t.)
  29. HP_data(D_SHADOWWIDTH,HPsetshadow()[1]*1.5) // Look in the manual for answer.
  30. HP_data(D_SHADOWGRAYPAT,30)
  31. HP_setpos(nTop,nLeft)
  32. HP_bar(nCalH,nCalW,GFILLGRAY,2)
  33. HPdrawmonth(date,nTop,nLeft,nCalH,nCalW)
  34.  
  35. nTop+=nCalH+nCalSp
  36. nCalW:=(nPageW-nCalSp) / 2
  37. date:=zaddmonth(date,-1)
  38. HP_data(D_SHADOWGRAYPAT,20)
  39. HP_data(D_LINEFILL,GFILLGRAY)
  40. HP_data(D_LINEGRAYPAT,40)
  41. nDayW := nCalW / 7
  42. nDayH := nCalH / 6
  43. HP_setpos( nTop+nDayH, nLeft + nDayW * 6)
  44. HP_bar(nCalH-nDayH,nDayW,GFILLGRAY,10)
  45. HPdrawmonth(date,nTop,nLeft,nCalH,nCalW)
  46.  
  47. nLeft+=nCalW+nCalSp
  48. date:=zaddmonth(date,1)
  49. HP_setpos( nTop+nDayH, nLeft + nDayW * 6)
  50. HP_bar(nCalH-nDayH,nDayW,GFILLGRAY,10)
  51. aCal := HPdrawmonth(date,nTop,nLeft,nCalH,nCalW)
  52.  
  53. HP_reset()      // reset printer to defautls.
  54. set2screen()
  55. return
  56.  
  57.  
  58.